using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using Cleverscape.UTorrentClient.WebClient;
using uTorrentNetClient.ModelDesign.Helper;
using System.Windows;

namespace uTorrentNetClient.ModelDesign.Converter.Settings
{
    [ValueConversion(typeof(SettingsValueType), typeof(Visibility))]
    public class ValueTypeBoolVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (targetType != typeof(Visibility))
            {
                return null;
            }
            if (value is SettingsValueType)
            {
                var valueType = (SettingsValueType)value;
                switch (valueType)
                {
                    case SettingsValueType.Text:
                    case SettingsValueType.Nummer:
                    case SettingsValueType.Integer:
                    case SettingsValueType.Password:
                        return Visibility.Hidden;
                    case SettingsValueType.Bool:
                        return Visibility.Visible;
                }
            }
            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
